import AsyncStorage from '../utils/AsyncStorage';
import gwApiRequest from '../utils/gwApiRequest';
import { cacheUpdateAtKey } from '../config/product';

export async function getProductConfig() {
  const catchUpdateAt = await AsyncStorage.getItem(cacheUpdateAtKey);
  const updateAt = catchUpdateAt || 1550218809552;
  return gwApiRequest(
    `/inner/app/products/config?timestamp=${updateAt}`,
    {
      method: 'GET',
    },
  );
}
